<template>
    <div class="con">
        <div class="header">
            <dl>
                <dd><img src="../assets/images/warn.png" alt=""></dd>
                <dt>根据监管要求，静态码超额交易需要通过识别下方动态码完成，点击页面按钮识别并完成付款</dt>
            </dl>

        </div>

        <div class="main">

            <div class="num">
                <p>
                    <span>¥</span>{{amount}}</p>
            </div>
            <p>爱玛电动车有限公司</p>
            <div class="ewm" id="qrcode">

            </div>

        </div>
        <p style="text-align:center;color:#0B94DE">投诉电话：025-6604 6356</p>

        <div style="height:80px"></div>
        <div class="btn" @click="ok()" :class="{ graybtn: isgraybtn }">
            识别并付款
        </div>

    </div>
</template>

<script>
import QRCode from "qrcodejs2";
export default {
    name: "payment",
    data() {
        return {
            amount: "",
            url: "",
            isgraybtn: false
        };
    },
    methods: {
        ok() {
            this.isgraybtn = true;
            window.location.href = this.url;
        }
    },
    mounted() {
        this.amount = this.$route.query.amount;
        this.url = this.$route.query.url;

        let qrcode = new QRCode("qrcode", {
            width: 220,
            height: 220, // 高度
            text: this.url // 二维码内容
        });
    }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.con {
    width: 100%;
    min-height: 100vh;
    background: #f5f5f5;
}
.con .header {
    width: 100%;
    height: 50px;
    background: #fff5d8;
}
.con dl {
    width: 90%;
    margin: 0 auto;
    padding-top: 5px;
}

.con dd {
    float: left;
    width: 8%;
    padding-top: 2px;
}
.con dd img {
    width: 14px;
    height: 14px;
}
.con dt {
    float: left;
    width: 92%;
    color: #ef403e;
    line-height: 18px;
}
.con .main {
    width: 90%;
    background: #fff;
    height: 400px;
    margin: 15px auto;
    border-radius: 4px;
    text-align: center;
}
.con .main p {
    margin-top: 30px;
    margin-bottom: 10px;
    font-size: 16px;
}
.con .main .num {
    height: 85px;
    line-height: 85px;
    width: 100%;
    text-align: center;
    border-bottom: 1px dashed #b8d6e6;
}

.con .main .num p {
    font-size: 34px;
    position: relative;
    display: inline;
}
.con .main .num span {
    font-size: 18px;
    position: absolute;
    left: -12px;
}

.btn {
    background: #0b94de;
    width: 100%;
    height: 64px;
    line-height: 64px;
    text-align: center;
    color: #fff;
    font-size: 18px;
    position: fixed;
    bottom: 0px;
    left: 0px;
}
.ewm {
    width: 220px;
    height: 220px;
    margin: 0 auto;
}

.graybtn {
    opacity: 0.5;
}
</style>
